import request from '@/utils/request'

export const login = data => {
  return request({
    url: 'user/login',
    method: 'get',
    params: data,
  })
}

export const loginWithWeChat = code => {
  return request({
    url: 'user/fastlogin',
    method: 'post',
    params: { code },
  })
}

export const getInfo = token => {
  return request({
    url: '/user/info',
    method: 'get',
    params: { token },
  })
}

export const register = data => {
  return request({
    url: '/user/register',
    method: 'get',
    params: data,
  })
}

export const logout = () => {
  return request({
    url: 'logout',
    method: 'post',
  })
}
